<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
  <div id="app">

    <my-component @my-event="handleEvent">确定</my-component>

  </div>
 
  <script>

    Vue.component('my-component', {
      template: `<button @click="$emit('my-event',100)"><slot>提交</slot></button>`
    })

    var vm = new Vue({
      el: "#app",
      methods:{
        handleEvent(n){
          console.log(n)
        }
      }
    })
  </script>
</body>

</html>